﻿using Abp.AspNetCore.Configuration;
using Abp.Modules;
using Abp.Reflection.Extensions;
using AbpProjectTemplate.Application;
using AbpProjectTemplate.Localization;

namespace AbpProjectTemplate.Web
{
    [DependsOn(typeof(AppWebCoreModule))]
    public class AppWebModule : AbpModule
    {
        public override void PreInitialize()
        {
            Configuration.Localization.ExtendXmlSource(this, AppConsts.LocalizationSourceName);
#if DEBUG
            Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
#endif
            this.Configuration.Modules.AbpAspNetCore()
                 .CreateControllersForAppServices(
                     typeof(AppApplicationModule).GetAssembly()
                 );
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(AppWebModule).GetAssembly());
        }
    }
}

